from flask import Flask
from flask_graphql import GraphQLView
import graphene

class Query(graphene.ObjectType):
    hello = graphene.String()
    
    def resolve_hello(self,info):
        return 'Hello Flask GraphQL!!'

if __name__ == '__main__':
    schema  = graphene.Schema(query= Query)

    app = Flask(__name__)

    app.add_url_rule('/graphql',view_func=GraphQLView.as_view('grapql',schema=schema, graphiql=True))
    app.run(debug=True)